﻿using Microsoft.Extensions.Primitives;
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace Xms.Abp.AspNetCore.Mvc.Models;

public class PageViewModel
{
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
    public List<object> Cols { get; set; }
    [JsonIgnore]
    public bool? ShowCheckbox { get; set; }
    [JsonIgnore]
    public Dictionary<string, string> RowTool { get; set; }
    [JsonIgnore]
    public string DataName { get; set; }
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
    public StringValues? Toolbar { get; set; }
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
    public List<string> DefaultToolbar { get; set; }
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
    public string Url { get; set; }
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
    public string Method { get; set; } = "POST";
}

public class PageViewItemModel
{
    public string Field { get; set; }
    public string Title { get; set; }
    public object Width { get; set; }
    public int? MinWidth { get; set; }
    public PageViewItemDataType? Type { get; set; }
    public PageViewItemFixedType? Fixed { get; set; }
    public bool? Hide { get; set; }
    public bool? Sort { get; set; }
    public bool? Unresize { get; set; }
    public string Event { get; set; }
    public string Style { get; set; }
    public string Align { get; set; }
    public int? Colspan { get; set; }
    public int? Rowspan { get; set; }
    public string Templet { get; set; }
    public string Toolbar { get; set; }
}

public enum PageViewItemDataType
{
    Normal,
    Checkbox,
    Radio,
    Numbers,
    Space,
}
public enum PageViewItemFixedType
{
    Left,
    Right
}

public enum PageViewRowTool
{
    Details,
    Review,
    Edit,
    Delete,
}

